<%@ page pageEncoding="UTF-8"%>
<%@ page trimDirectiveWhitespaces="true"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="isperp" uri="/WEB-INF/tlds/isperp.tld"%>

<style>
	textarea{
		height:30px; width:90%;resize: none;
	}
	
	.plan input{
		width:70%;
	} 
	
	.short{
		width:100px;
	}
	
	.medium{
		width:120px;
	}
	
	.long{
		width:250px;
	}
	
	.plan td{
		border:1px solid black;
		text-align:center;
	}
</style>


   <div style="margin:0 auto;text-align: center;margin-top:200px;">
	<input type="button" onclick="openDialogCoverPrint()" class="button nui-mainbtn"  value="打印封面"/>
	
	<input type="button" onclick="openDialogReport()" class="button nui-mainbtn" value="打印报表"/>
	</div>
	<div id="dialogCoverPrint" title="封面打印" style="display:none">
		<form id="formCoverPrint" action="print/print/printReport1" 
		class="full validate">
			<table class="search-table" style="width:630px;margin:10px 5px">
			<tr>
				<td class="td1">公司名称：</td>
				<td class="td2"><input id="name"
					type="text"/></td>
			</tr>
			<tr>
				<td class="td1">服务所属时间：</td>
				<td class="td2"><input id="time"
					type="date" name="time" /></td>
			</tr>
			<tr>
				<td class="td1">单位负责人：</td>
				<td class="td2"><input id="headOfUnit"
					type="text" name="headOfUnit" /></td>
				<td class="td1">联系电话：</td>
				<td class="td2"><input id="telOfUnit"
					type="text" name="telOfUnit" /></td>
			</tr>
			<tr>
				<td class="td1">项目负责人：</td>
				<td class="td2"><input id="projManager"
					type="text" name="projManager" /></td>
				<td class="td1">联系电话：</td>
				<td class="td2"><input id="telOfProj"
					type="text" name="telOfProj" /></td>
			</tr>
			<tr>
				<td class="td1">技术专员：</td>
				<td class="td2"><input id="officer"
					type="text" name="officer" /></td>
				<td class="td1">联系电话：</td>
				<td class="td2"><input id="telOfOfficer"
					type="text" name="telOfOfficer" /></td>
			</tr>
		</table>
		</form>
	</div>
	
	<div id="dialogReport"  class="box tabbedBox" title="报表打印" style="display:none">
		<div class="header">
			<ul>
				<li><a class="current" href="#baseData">基础信息</a>
				</li>
				<li><a href="#workPlan">工作安排</a>
				</li>
			</ul>
		</div>
	
		<table id="baseData" class="search-table" style="width:630px;margin:10px 5px">
			<tr>
				<td class="td1">公司名称：</td>
				<td class="td2"><input id="companyName"
					type="text"/></td>
			</tr>
			<tr>
				<td class="td1">年份：</td>
				<td class="td2"><input id="year" type="text"/></td>
				<td class="td1">季度：</td>
				<td class="td2"><select id="season">
					<option value="第一季度">第一季度</option>
					<option value="第二季度">第二季度</option>
					<option value="第三季度">第三季度</option>
					<option value="第四季度">第四季度</option>
				</select></td>
			</tr>
			<!-- <tr>
				<td class="td1">设备故障次数：</td>
				<td class="td2"><input id="eqpTimes" type="text"/></td>
				<td class="td1">打印机故障次数：</td>
				<td class="td2"><input id="prtTimes"
					type="text"/></td>
			</tr>
			<tr>
				<td class="td1">监控故障次数：</td>
				<td class="td2"><input id="mtTimes" type="text"/></td>
				<td class="td1">电话故障次数：</td>
				<td class="td2"><input id="telTimes"
					type="text"/></td>
			</tr>
			<tr>
				<td class="td1">电脑故障次数：</td>
				<td class="td2"><input id="comTimes" type="text"/></td>
				<td class="td1">路由器故障次数：</td>
				<td class="td2"><input id="routerTimes"
					type="text"/></td>
			</tr> 
			<tr>
				<td class="td1">其他情况：</td>
				<td class="td2" colspan="3"><textarea id="other"></textarea></td>
			</tr>
			<tr>
				<td class="td1">已处理情况：</td>
				<td class="td2" colspan="3"><textarea id="processed"></textarea></td>
			</tr>
			<tr>
				<td class="td1">待处理情况：</td>
				<td class="td2" colspan="3"><textarea id="pending"></textarea></td>
			</tr>-->
			<tr>
				<td class="td1">本季度工作重点：</td>
				<td class="td2" colspan="3"><textarea id="keyOfWork"></textarea></td>
			</tr>
			<tr>
				<td class="td1">本季度工作进度：</td>
				<td class="td2" colspan="3"><textarea id="schedule"></textarea></td>
			</tr>
			<tr>
				<td class="td1">工作中发现的问题<br>及改进建议：</td>
				<td class="td2" colspan="3"><textarea id="suggestion"></textarea></td>
			</tr>
		</table>
		
		<div id="workPlan">
		<table class="plan" class="search-table" style="width:680px;margin:10px 5px">
			<tr><th colspan="8" style="text-align: center">下季度工作计划</th></tr>
			<tr>
				<td style="width:30px">序号</td><td class="long">时间</td><td class="long">本季度工作重点</td><td class="long">完成时间</td>
				<td class="medium">完成标准</td><td class="short">负责人</td><td class="short">监督人</td><td class="medium">备注</td>
			</tr>
			<tr>
				<td>1</td><td><input id="pTime1" type="datetime" /></td>
				<td><input id="pKey1" type="text"/></td><td><input id="pCompleteTime1" type="datetime"/></td>
				<td><input id="pStandard1" type="text"/></td><td><input id="pManage1" type="text"/></td>
				<td><input id="pCustodian1" type="text"/></td><td><input id="pRemark1" type="text"/></td>
			</tr>
			<tr>
				<td>2</td><td><input id="pTime2" type="datetime" /></td>
				<td><input id="pKey2" type="text"/></td><td><input id="pCompleteTime2" type="datetime"/></td>
				<td><input id="pStandard2" type="text"/></td><td><input id="pManage2" type="text"/></td>
				<td><input id="pCustodian2" type="text"/></td><td><input id="pRemark2" type="text"/></td>
			</tr>
			<tr>
				<td>3</td><td><input id="pTime3" type="datetime" /></td>
				<td><input id="pKey3" type="text"/></td><td><input id="pCompleteTime3" type="datetime"/></td>
				<td><input id="pStandard3" type="text"/></td><td><input id="pManage3" type="text"/></td>
				<td><input id="pCustodian3" type="text"/></td><td><input id="pRemark3" type="text"/></td>
			</tr>
			<tr>
				<td>4</td><td><input id="pTime4" type="datetime" /></td>
				<td><input id="pKey4" type="text"/></td><td><input id="pCompleteTime4" type="datetime"/></td>
				<td><input id="pStandard4" type="text"/></td><td><input id="pManage4" type="text"/></td>
				<td><input id="pCustodian4" type="text"/></td><td><input id="pRemark4" type="text"/></td>
			</tr>
		</table>
		
		<table class="plan" class="search-table" style="width:680px;margin:10px 5px">
			<tr><th colspan="8" style="text-align: center">其他工作</th></tr>
			<tr>
				<td style="width:30px">序号</td><td class="long">时间</td><td class="long">工作事项</td><td class="long">完成时间</td>
				<td class="medium">完成标准</td><td class="short">负责人</td><td class="short">监督人</td><td class="medium">备注</td>
			</tr>
			<tr>
				<td>1</td><td><input id="opTime1" type="datetime" /></td>
				<td><input id="opKey1" type="text"/></td><td><input id="opCompleteTime1" type="datetime"/></td>
				<td><input id="opStandard1" type="text"/></td><td><input id="opManage1" type="text"/></td>
				<td><input id="opCustodian1" type="text"/></td><td><input id="opRemark1" type="text"/></td>
			</tr>
			<tr>
				<td>2</td><td><input id="opTime2" type="datetime" /></td>
				<td><input id="opKey2" type="text"/></td><td><input id="opCompleteTime2" type="datetime"/></td>
				<td><input id="opStandard2" type="text"/></td><td><input id="opManage2" type="text"/></td>
				<td><input id="opCustodian2" type="text"/></td><td><input id="opRemark2" type="text"/></td>
			</tr>
			<tr>
				<td>3</td><td><input id="opTime3" type="datetime" /></td>
				<td><input id="opKey3" type="text"/></td><td><input id="opCompleteTime3" type="datetime"/></td>
				<td><input id="opStandard3" type="text"/></td><td><input id="opManage3" type="text"/></td>
				<td><input id="opCustodian3" type="text"/></td><td><input id="opRemark3" type="text"/></td>
			</tr>
			<tr>
				<td>4</td><td><input id="opTime4" type="datetime" /></td>
				<td><input id="opKey4" type="text"/></td><td><input id="opCompleteTime4" type="datetime"/></td>
				<td><input id="opStandard4" type="text"/></td><td><input id="opManage4" type="text"/></td>
				<td><input id="opCustodian4" type="text"/></td><td><input id="opRemark4" type="text"/></td>
			</tr>
		</table>
		</div>
	</div>

<script type="text/javascript">
	 $(function(){
		$("#dialogCoverPrint").dialog({
				autoOpen : false,
				resizable : false,
				width : 700,
				buttons : [ {
					text : "保存",
					"class" : "nui-mainbtn",
					click : function() {
						var name = $("#name").val();
						var time = $("#time").val();
						var headOfUnit = $("#headOfUnit").val();
						var telOfUnit = $("#telOfUnit").val();
						var projManager = $("#projManager").val();
						var telOfProj = $("#telOfProj").val();
						var officer = $("#officer").val();
						var telOfOfficer = $("#telOfOfficer").val();
						
						window.open("print/print/printReport1?name="+name+"&time="+time+"&headOfUnit="+headOfUnit+"&telOfUnit="+
						telOfUnit+"&projManager="+projManager+"&telOfProj="+telOfProj+"&officer="+officer+"&telOfOfficer="+telOfOfficer);
						
					}
				}, {
					text : "关闭",
					click : function() {
						$(this).dialog("close");
					}
				} ]
		});
	}); 
	
	$(function(){
		$("#dialogReport").dialog({
			autoOpen : false,
			resizable : false,
			width : 700,
			height: 550,
			buttons : [{
				text : "保存",
				"class" : "nui-mainbtn",
				click : function(){
					var companyName = $("#companyName").val();
					var year = $("#year").val();
					var season = $("#season").val();
					var eqpTimes = $("#eqpTimes").val();
					var prtTimes = $("#prtTimes").val();
					var mtTimes = $("#mtTimes").val();
					var telTimes = $("#telTimes").val();
					var comTimes = $("#comTimes").val();
					var routerTimes = $("#routerTimes").val();
					var other = $("#other").val();
					var processed = $("#processed").val();
					var pending = $("#pending").val();
					var keyOfWork = $("#keyOfWork").val();
					keyOfWork=keyOfWork.replace(new RegExp("\n", "gm"), "<br>");
					var schedule = $("#schedule").val();
					schedule=schedule.replace(new RegExp("\n", "gm"), "<br>");
					var suggestion = $("#suggestion").val();
					suggestion=suggestion.replace(new RegExp("\n", "gm"), "<br>");
					//下季度工作计划
					var pTime1 = $("#pTime1").val();
					var pKey1 = $("#pKey1").val();
					var pCompleteTime1 = $("#pCompleteTime1").val();
					var pStandard1 = $("#pStandard1").val();
					var pManage1 = $("#pManage1").val();
					var pCustodian1 = $("#pCustodian1").val();
					var pRemark1 = $("#pRemark1").val();
					
					var pTime2 = $("#pTime2").val();
					var pKey2 = $("#pKey2").val();
					var pCompleteTime2 = $("#pCompleteTime2").val();
					var pStandard2 = $("#pStandard2").val();
					var pManage2 = $("#pManage2").val();
					var pCustodian2 = $("#pCustodian2").val();
					var pRemark2 = $("#pRemark2").val();
					
					var pTime3 = $("#pTime3").val();
					var pKey3 = $("#pKey3").val();
					var pCompleteTime3 = $("#pCompleteTime3").val();
					var pStandard3 = $("#pStandard3").val();
					var pManage3 = $("#pManage3").val();
					var pCustodian3 = $("#pCustodian3").val();
					var pRemark3 = $("#pRemark3").val();
					
					var pTime4 = $("#pTime4").val();
					var pKey4 = $("#pKey4").val();
					var pCompleteTime4 = $("#pCompleteTime4").val();
					var pStandard4 = $("#pStandard4").val();
					var pManage4 = $("#pManage4").val();
					var pCustodian4 = $("#pCustodian4").val();
					var pRemark4 = $("#pRemark4").val();
					
					//其他工作安排
					var opTime1 = $("#opTime1").val();
					var opKey1 = $("#opKey1").val();
					var opCompleteTime1 = $("#opCompleteTime1").val();
					var opStandard1 = $("#opStandard1").val();
					var opManage1 = $("#opManage1").val();
					var opCustodian1 = $("#opCustodian1").val();
					var opRemark1 = $("#opRemark1").val();
					
					var opTime2 = $("#opTime2").val();
					var opKey2 = $("#opKey2").val();
					var opCompleteTime2 = $("#opCompleteTime2").val();
					var opStandard2 = $("#opStandard2").val();
					var opManage2 = $("#opManage2").val();
					var opCustodian2 = $("#opCustodian2").val();
					var opRemark2 = $("#opRemark2").val();
					
					var opTime3 = $("#opTime3").val();
					var opKey3 = $("#opKey3").val();
					var opCompleteTime3 = $("#opCompleteTime3").val();
					var opStandard3 = $("#opStandard3").val();
					var opManage3 = $("#opManage3").val();
					var opCustodian3 = $("#opCustodian3").val();
					var opRemark3 = $("#opRemark3").val();
					
					var opTime4 = $("#opTime4").val();
					var opKey4 = $("#opKey4").val();
					var opCompleteTime4 = $("#opCompleteTime4").val();
					var opStandard4 = $("#opStandard4").val();
					var opManage4 = $("#opManage4").val();
					var opCustodian4 = $("#opCustodian4").val();
					var opRemark4 = $("#opRemark4").val();
					
					var url = "print/print/printReport2?companyName="+companyName+"&year="+year+"&season="+season+"&eqpTimes="
					+eqpTimes+"&prtTimes="+prtTimes+"&mtTimes="+mtTimes+"&telTimes="+telTimes+"&comTimes="+comTimes
					+"&routerTimes="+routerTimes+"&other="+other+"&processed="+processed+"&pending="+pending+"&keyOfWork="+keyOfWork+"&schedule="+schedule+"&suggestion="+suggestion
					+"&pTime1="+pTime1+"&pKey1="+pKey1+"&pCompleteTime1="+pCompleteTime1+"&pStandard1="+pStandard1+"&pManage1="+pManage1+"&pCustodian1="+pCustodian1+"&pRemark1="+pRemark1
					+"&pTime2="+pTime2+"&pKey2="+pKey2+"&pCompleteTime2="+pCompleteTime2+"&pStandard2="+pStandard2+"&pManage2="+pManage2+"&pCustodian2="+pCustodian2+"&pRemark2="+pRemark2
					+"&pTime3="+pTime3+"&pKey3="+pKey3+"&pCompleteTime3="+pCompleteTime3+"&pStandard3="+pStandard3+"&pManage3="+pManage3+"&pCustodian3="+pCustodian3+"&pRemark3="+pRemark3
					+"&pTime4="+pTime4+"&pKey4="+pKey4+"&pCompleteTime4="+pCompleteTime4+"&pStandard4="+pStandard4+"&pManage4="+pManage4+"&pCustodian4="+pCustodian4+"&pRemark4="+pRemark4
					+"&opTime1="+opTime1+"&opKey1="+opKey1+"&opCompleteTime1="+opCompleteTime1+"&opStandard1="+opStandard1+"&opManage1="+opManage1+"&opCustodian1="+opCustodian1+"&opRemark1="+opRemark1
					+"&opTime2="+opTime2+"&opKey2="+opKey2+"&opCompleteTime2="+opCompleteTime2+"&opStandard2="+opStandard2+"&opManage2="+opManage2+"&opCustodian2="+opCustodian2+"&opRemark2="+opRemark2
					+"&opTime3="+opTime3+"&opKey3="+opKey3+"&opCompleteTime3="+opCompleteTime3+"&opStandard3="+opStandard3+"&opManage3="+opManage3+"&opCustodian3="+opCustodian3+"&opRemark3="+opRemark3
					+"&opTime4="+opTime4+"&opKey4="+opKey4+"&opCompleteTime4="+opCompleteTime4+"&opStandard4="+opStandard4+"&opManage4="+opManage4+"&opCustodian4="+opCustodian4+"&opRemark4="+opRemark4;
					window.open(url);
				}
			}, {
					text : "关闭",
					click : function() {
						$(this).dialog("close");
					}
				}]
		})
	});

	function openDialogCoverPrint() {
		$("#dialogCoverPrint").dialog("open");
	}
	
	function openDialogReport(){
		$("#dialogReport").dialog("open");
	}
</script>
